package String;
/**
 * String trim()
 * 去除字符串两侧的空白符
 * */
import com.sun.xml.internal.ws.message.MimeAttachmentSet;

import java.net.SocketImpl;

public class TrimDemo {
    public static void main(String[] args) {
        String str = "   hello   ";
        System.out.println(str);//没有去空白
        String trim = str.trim();//去除空白
        System.out.println(trim);

        String str1 = "   he   llo   ";
        System.out.println(str1);
        String trim1 = str1.trim();//去除空白只去两边的空白，不去中间的空白
        System.out.println(trim1);
    }
}
